import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/about",
    name: "About",
    component: () => import(/* webpackChunkName: "about" */ "../views/About.vue"),
  },
  // {
  //   path: '/',
  //   name: 'dimension',
  //   component: () => import('@/views/dimension/Main.vue'),
  //   redirect: '/',
  //   children: [{
  //     path: '/',
  //     name: 'Index',
  //     component: () => import('@/views/dimension/Index.vue')
  //   }
  //   ]
  // }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

// router.beforeEach((to, from, next) => { 
//   let user = store.state.variable.userData; 
//   if (user.state) {
//     next();
//   } else {
//     if (to.path === '/login') {
//       next();
//     } else {
//       next({ path: '/login' })
//     }
//   }
// });

export default router;
